package me.leon.keeplive

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.os.Build
import android.util.Log

class HeartBeatReceiver : BroadcastReceiver() {

    override fun onReceive(context: Context, intent: Intent) {
        Log.d("heartbeat", "HeartBeatReceiver")
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
            context.startForegroundService(Intent(context, ExactWorkService::class.java))
        else context.startService(Intent(context, ExactWorkService::class.java))
    }
}
